﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace ConceptCorporateAdmin
{
    public partial class InputBox : Form
    {
        String raspuns = "";

        public String Raspuns
        {
            get { return raspuns; }
        }

        public InputBox(string intrebare, string default_value)
        {
            InitializeComponent();
            LblIntrebare.Text = intrebare;
            TxtValoare.Text = default_value;
        }

        public static String ShowMe(String intrebare)
        {
            return ShowMe(intrebare, "");
        }

        public static String ShowMe(String intrebare, string default_value)
        {
            InputBox dlg = new InputBox(intrebare, default_value);
            dlg.ShowDialog();
            return dlg.Raspuns;
        }

        private void BtnOk_Click(object sender, EventArgs e)
        {
            raspuns = TxtValoare.Text;
            Close();
        }

        private void BtnRenunta_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void TxtValoare_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Return)
                BtnOk_Click(BtnOk, new EventArgs());
        }

    }
}
